
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>我折腾的shell笔记 · Summary</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-xonokai.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="关于Xcode12静态库打包的一些心得.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                        <b>1.1.</b>
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../workflows/">
            
                <a href="../workflows/">
            
                    
                        <b>1.2.</b>
                    
                    workflows相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../workflows/iOS开发如何给自己的App增加捷径自定义拓展.html">
            
                <a href="../workflows/iOS开发如何给自己的App增加捷径自定义拓展.html">
            
                    
                        <b>1.2.1.</b>
                    
                    iOS开发如何给自己的App增加捷径自定义拓展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../workflows/如何制作一个手机上的Github图床捷径workflow.html">
            
                <a href="../workflows/如何制作一个手机上的Github图床捷径workflow.html">
            
                    
                        <b>1.2.2.</b>
                    
                    如何制作一个手机上的Github图床捷径(workflow)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../AppleScript/">
            
                <a href="../AppleScript/">
            
                    
                        <b>1.3.</b>
                    
                    AppleScript相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../AppleScript/关于AppleScript脚本语言的一些使用总结.html">
            
                <a href="../AppleScript/关于AppleScript脚本语言的一些使用总结.html">
            
                    
                        <b>1.3.1.</b>
                    
                    关于AppleScript脚本语言的一些使用总结
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../AppleScript/为Mac自带的AppleScript脚本编辑器增加代码注释快捷键.html">
            
                <a href="../AppleScript/为Mac自带的AppleScript脚本编辑器增加代码注释快捷键.html">
            
                    
                        <b>1.3.2.</b>
                    
                    为Mac自带的AppleScript脚本编辑器增加代码注释快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../AppleScript/say指令让Mac说话.html">
            
                <a href="../AppleScript/say指令让Mac说话.html">
            
                    
                        <b>1.3.3.</b>
                    
                    say指令让Mac开口说话
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.4.</b>
                    
                    Shell相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.4.1" data-path="我折腾的shell笔记.html">
            
                <a href="我折腾的shell笔记.html">
            
                    
                        <b>1.4.1.</b>
                    
                    我折腾的shell笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="关于Xcode12静态库打包的一些心得.html">
            
                <a href="关于Xcode12静态库打包的一些心得.html">
            
                    
                        <b>1.4.2.</b>
                    
                    关于Xcode12静态库打包的一些心得
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="剪贴板的使用.html">
            
                <a href="剪贴板的使用.html">
            
                    
                        <b>1.4.3.</b>
                    
                    剪贴板的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="指定入参的使用.html">
            
                <a href="指定入参的使用.html">
            
                    
                        <b>1.4.4.</b>
                    
                    指定入参的使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../git-about/">
            
                <a href="../git-about/">
            
                    
                        <b>1.5.</b>
                    
                    git相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../git-about/git使用技巧总结.html">
            
                <a href="../git-about/git使用技巧总结.html">
            
                    
                        <b>1.5.1.</b>
                    
                    git使用技巧总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >我折腾的shell笔记</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x6211;&#x6298;&#x817E;&#x7684;shell&#x7B14;&#x8BB0;">&#x6211;&#x6298;&#x817E;&#x7684;shell&#x7B14;&#x8BB0;</h1>
<ul>
<li><a href="#mac&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x5FEB;&#x6377;&#x952E;&#x8BB0;&#x5F55;">Mac&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x5FEB;&#x6377;&#x952E;&#x8BB0;&#x5F55;</a><ul>
<li><a href="#iterm2&#x6216;&#x8005;&#x547D;&#x4EE4;&#x884C;&#x76F8;&#x5173;">iTerm2&#x6216;&#x8005;&#x547D;&#x4EE4;&#x884C;&#x76F8;&#x5173;</a></li>
<li><a href="#mac&#x684C;&#x9762;&#x4E0A;&#x6216;&#x8005;&#x67D0;&#x76EE;&#x5F55;&#x4E0B;&#x64CD;&#x4F5C;">Mac&#x684C;&#x9762;&#x4E0A;&#x6216;&#x8005;&#x67D0;&#x76EE;&#x5F55;&#x4E0B;&#x64CD;&#x4F5C;</a></li>
</ul>
</li>
<li><a href="#&#x4E00;&#x4E9B;&#x5B9E;&#x7528;&#x811A;&#x672C;&#x793A;&#x4F8B;">&#x4E00;&#x4E9B;&#x5B9E;&#x7528;&#x811A;&#x672C;&#x793A;&#x4F8B;</a><ul>
<li><a href="#&#x4EE3;&#x7801;&#x65E0;&#x63D0;&#x793A;&#x6216;&#x8005;&#x5176;&#x4ED6;&#x62BD;&#x98CE;&#x75C7;&#x72B6;&#x6E05;&#x9664;xcode&#x7F13;&#x5B58;">&#x4EE3;&#x7801;&#x65E0;&#x63D0;&#x793A;&#x6216;&#x8005;&#x5176;&#x4ED6;&#x62BD;&#x98CE;&#x75C7;&#x72B6;,&#x6E05;&#x9664;Xcode&#x7F13;&#x5B58;</a></li>
<li><a href="#&#x67E5;&#x770B;&#x5F53;&#x524D;&#x7F51;&#x7EDC;ip&#x5730;&#x5740;">&#x67E5;&#x770B;&#x5F53;&#x524D;&#x7F51;&#x7EDC;ip&#x5730;&#x5740;</a></li>
<li><a href="#&#x65E5;&#x5E38;&#x63D0;&#x4EA4;&#x63A8;&#x9001;git&#x4EE3;&#x7801;">&#x65E5;&#x5E38;&#x63D0;&#x4EA4;&#x63A8;&#x9001;git&#x4EE3;&#x7801;</a></li>
<li><a href="#&#x7EDF;&#x8BA1;ios&#x4EE3;&#x7801;&#x884C;&#x6570;">&#x7EDF;&#x8BA1;iOS&#x4EE3;&#x7801;&#x884C;&#x6570;</a></li>
<li><a href="#plistbuddy&#x76F8;&#x5173;&#x7684;&#x64CD;&#x4F5C;">Plistbuddy&#x76F8;&#x5173;&#x7684;&#x64CD;&#x4F5C;</a></li>
</ul>
</li>
<li><a href="#&#x4FEE;&#x6539;&#x7EC8;&#x7AEF;&#x6B22;&#x8FCE;&#x9875;&#x9762;">&#x4FEE;&#x6539;&#x7EC8;&#x7AEF;&#x6B22;&#x8FCE;&#x9875;&#x9762;</a></li>
<li><a href="#oh-my-zsh&#x7684;agnoster&#x7684;&#x4E3B;&#x9898;&#x914D;&#x7F6E;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x51E0;&#x4E2A;&#x95EE;&#x9898;">oh-my-zsh&#x7684;agnoster&#x7684;&#x4E3B;&#x9898;&#x914D;&#x7F6E;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x51E0;&#x4E2A;&#x95EE;&#x9898;</a></li>
</ul>
<p><a href="https://github.com/WangGuibin/WGBToolsConfigRepository/blob/master/Shell/README.md" target="_blank">shell &#x4EE3;&#x7801;&#x96C6;&#x5408;</a></p>
<h2 id="mac&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x5FEB;&#x6377;&#x952E;&#x8BB0;&#x5F55;">Mac&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x5FEB;&#x6377;&#x952E;&#x8BB0;&#x5F55;</h2>
<h3 id="iterm2&#x6216;&#x8005;&#x547D;&#x4EE4;&#x884C;&#x76F8;&#x5173;">iTerm2&#x6216;&#x8005;&#x547D;&#x4EE4;&#x884C;&#x76F8;&#x5173;</h3>
<table>
<thead>
<tr>
<th><strong>&#x547D;&#x4EE4;</strong></th>
<th><strong>&#x8BF4;&#x660E;</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ctrl + d</code></td>
<td>&#x5220;&#x9664;&#x5F53;&#x524D;&#x5149;&#x6807;&#x7684;&#x5B57;&#x7B26;</td>
</tr>
<tr>
<td><code>ctrl + h</code></td>
<td>&#x5220;&#x9664;&#x5149;&#x6807;&#x4E4B;&#x524D;&#x7684;&#x5B57;&#x7B26;</td>
</tr>
<tr>
<td><code>ctrl + w</code></td>
<td>&#x6309;&#x5355;&#x8BCD;(<code>word</code>)&#x5355;&#x6B65;&#x5220;&#x9664;&#x8F93;&#x5165;&#x7684;&#x547D;&#x4EE4;</td>
</tr>
<tr>
<td><code>ctrl + a</code></td>
<td>&#x5149;&#x6807;&#x79FB;&#x52A8;&#x5230;&#x884C;&#x9996;</td>
</tr>
<tr>
<td><code>ctrl + e</code></td>
<td>&#x5149;&#x6807;&#x79FB;&#x52A8;&#x5230;&#x884C;&#x5C3E;</td>
</tr>
<tr>
<td><code>ctrl + f/b</code></td>
<td>&#x524D;&#x8FDB;&#x540E;&#x9000;&#xFF1A; (&#x76F8;&#x5F53;&#x4E8E;&#x5DE6;&#x53F3;&#x65B9;&#x5411;&#x952E;)</td>
</tr>
<tr>
<td><code>ctrl + p</code></td>
<td>&#x4E0A;&#x4E00;&#x6761;&#x547D;&#x4EE4;</td>
</tr>
<tr>
<td><code>ctrl + r</code></td>
<td>&#x641C;&#x7D22;&#x547D;&#x4EE4;&#x5386;&#x53F2;</td>
</tr>
<tr>
<td><code>ctrl + t</code></td>
<td>&#x4EA4;&#x6362;&#x5149;&#x6807;&#x5904;&#x6587;&#x672C;</td>
</tr>
<tr>
<td><code>ctrl + k</code></td>
<td>&#x5220;&#x9664;&#x5230;&#x6587;&#x672C;&#x672B;&#x5C3E;</td>
</tr>
<tr>
<td><code>&#x2318; + r</code> &#x6216; <code>ctrl + l</code></td>
<td>&#x6E05;&#x5C4F;(<code>&#x2318; + r</code> = <code>clear</code>&#xFF0C;&#x800C;&#x4E14;&#x53EA;&#x662F;&#x6362;&#x5230;&#x65B0;&#x4E00;&#x5C4F;&#xFF0C;&#x4E0D;&#x4F1A;&#x60F3; <code>clear</code> &#x4E00;&#x6837;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x7A7A;&#x5C4F;)</td>
</tr>
<tr>
<td><code>ctrl + q</code> , <code>ctrl + u</code></td>
<td>&#x6E05;&#x9664;&#x8F93;&#x5165;&#x7684;&#x547D;&#x4EE4;&#x884C;&#x5F53;&#x524D;&#x884C;</td>
</tr>
<tr>
<td><code>open ./</code></td>
<td>&#x5F39;&#x51FA;&#x5F53;&#x524D;&#x76EE;&#x5F55;<code>finder</code></td>
</tr>
<tr>
<td><code>&#x2318; + t</code></td>
<td>&#x65B0;&#x5EFA;&#x6807;&#x7B7E;&#x9875;</td>
</tr>
<tr>
<td><code>&#x2318; + w</code></td>
<td>&#x5173;&#x95ED;&#x6807;&#x7B7E;&#x9875;</td>
</tr>
<tr>
<td><code>&#x2318; + &#x6570;&#x5B57;</code> &#x6216; <code>&#x2318; + &#x5DE6;&#x53F3;&#x65B9;&#x5411;&#x952E;</code></td>
<td>&#x5207;&#x6362;&#x6807;&#x7B7E;&#x9875;</td>
</tr>
<tr>
<td><code>&#x2318; + enter</code></td>
<td>&#x5207;&#x6362;&#x5168;&#x5C4F;</td>
</tr>
<tr>
<td><code>&#x2318; + f</code></td>
<td>&#x67E5;&#x627E;</td>
</tr>
<tr>
<td><code>&#x2318; + d</code></td>
<td>&#x5782;&#x76F4;&#x5206;&#x5C4F;</td>
</tr>
<tr>
<td><code>&#x2318; + shift + d</code></td>
<td>&#x6C34;&#x5E73;&#x5206;&#x5C4F;</td>
</tr>
<tr>
<td><code>&#x2318; + option + &#x65B9;&#x5411;&#x952E;</code>&#x6216; <code>&#x2318; + [</code> &#x6216; <code>&#x2318; + ]</code></td>
<td>&#x5207;&#x6362;&#x5C4F;&#x5E55;</td>
</tr>
<tr>
<td><code>&#x2318; + ;</code></td>
<td>&#x67E5;&#x770B;&#x5386;&#x53F2;&#x547D;&#x4EE4;</td>
</tr>
<tr>
<td><code>&#x2318; + shift + h</code></td>
<td>&#x67E5;&#x770B;&#x526A;&#x8D34;&#x677F;&#x5386;&#x53F2;</td>
</tr>
<tr>
<td><code>&#x2318; + f</code></td>
<td>&#x67E5;&#x627E;</td>
</tr>
</tbody>
</table>
<h3 id="mac&#x684C;&#x9762;&#x4E0A;&#x6216;&#x8005;&#x67D0;&#x76EE;&#x5F55;&#x4E0B;&#x64CD;&#x4F5C;">Mac&#x684C;&#x9762;&#x4E0A;&#x6216;&#x8005;&#x67D0;&#x76EE;&#x5F55;&#x4E0B;&#x64CD;&#x4F5C;</h3>
<ul>
<li><code>&#x2318; + shift + G</code> &#x524D;&#x5F80;&#x6587;&#x4EF6;&#x5939;</li>
<li><code>&#x2318; + space</code> &#x805A;&#x7126;&#x641C;&#x7D22;&#x5373;&#x5168;&#x5C40;&#x641C;&#x7D22;</li>
<li><code>&#x2318; + shift + .</code> &#x9690;&#x85CF;/&#x663E;&#x793A;&#x9690;&#x85CF;&#x6587;&#x4EF6;&#x6216;&#x6587;&#x4EF6;&#x5939;</li>
<li><code>&#x2318; + shift + 3</code> &#x5168;&#x5C4F;&#x622A;&#x56FE;  </li>
<li><code>&#x2318; + shift + 4</code> &#x53EF;&#x9009;&#x53D6;&#x8303;&#x56F4;&#x622A;&#x56FE;</li>
<li><code>ctrl + &#x2318; + space</code> &#x5F39;&#x51FA;<code>emoji</code>&#x9009;&#x62E9;&#x7A97;&#x53E3;</li>
<li><code>ctrl + &#x2190;</code> &#x5411;&#x5DE6;&#x5207;&#x6362;&#x684C;&#x9762;</li>
<li><code>ctrl + &#x2192;</code> &#x5411;&#x53F3;&#x5207;&#x6362;&#x684C;&#x9762;</li>
<li><code>ctrl + &#x2191;</code> &#x663E;&#x793A;&#x5168;&#x90E8;&#x684C;&#x9762;&#x9009;&#x62E9;</li>
<li><code>ctrl + &#x2193;</code> &#x663E;&#x793A;&#x6700;&#x8FD1;&#x6253;&#x5F00;&#x7F16;&#x8F91;&#x8FC7;&#x7684;&#x6587;&#x4EF6;</li>
<li><code>&#x2318; + tab</code> &#x5207;&#x6362;&#x5DF2;&#x6253;&#x5F00;&#x7A0B;&#x5E8F;&#x575E;&#x4E0A;&#x7684;&#x5E94;&#x7528;</li>
<li><code>&#x2318; + q</code> &#x5173;&#x95ED;&#x5F53;&#x524D;&#x7A0B;&#x5E8F;</li>
<li><code>&#x2318; + w</code> &#x5173;&#x95ED;&#x5F53;&#x524D;&#x7A97;&#x53E3;</li>
<li><code>&#x2318; + n</code> &#x65B0;&#x5EFA;&#x6587;&#x4EF6;</li>
<li><code>&#x2318; + s</code> &#x4FDD;&#x5B58;</li>
<li><code>&#x2318; + ,</code> &#x5F53;&#x524D;&#x5E94;&#x7528;&#x7684;&#x504F;&#x597D;&#x8BBE;&#x7F6E;</li>
<li><code>ctrl + space</code> &#x5207;&#x6362;&#x8F93;&#x5165;&#x6CD5;</li>
</ul>
<h2 id="&#x4E00;&#x4E9B;&#x5B9E;&#x7528;&#x811A;&#x672C;&#x793A;&#x4F8B;">&#x4E00;&#x4E9B;&#x5B9E;&#x7528;&#x811A;&#x672C;&#x793A;&#x4F8B;</h2>
<h3 id="&#x4EE3;&#x7801;&#x65E0;&#x63D0;&#x793A;&#x6216;&#x8005;&#x5176;&#x4ED6;&#x62BD;&#x98CE;&#x75C7;&#x72B6;&#x6E05;&#x9664;xcode&#x7F13;&#x5B58;">&#x4EE3;&#x7801;&#x65E0;&#x63D0;&#x793A;&#x6216;&#x8005;&#x5176;&#x4ED6;&#x62BD;&#x98CE;&#x75C7;&#x72B6;,&#x6E05;&#x9664;Xcode&#x7F13;&#x5B58;</h3>
<pre class="language-"><code class="lang-shell"><span class="token shebang important">#!/bin/bash</span>
defaults <span class="token function">write</span> com.apple.dt.XCode IDEIndexDisable <span class="token number">0</span>
<span class="token function">rm</span> -rf ~/Library/Developer/Xcode/DerivedData
<span class="token function">rm</span> -rf ~/Library/Caches/com.apple.dt.Xcode
<span class="token comment"># &#x5173;&#x95ED;Xcode </span>
<span class="token function">killall</span> Xcode
</code></pre>
<h3 id="&#x67E5;&#x770B;&#x5F53;&#x524D;&#x7F51;&#x7EDC;ip&#x5730;&#x5740;">&#x67E5;&#x770B;&#x5F53;&#x524D;&#x7F51;&#x7EDC;ip&#x5730;&#x5740;</h3>
<pre class="language-"><code class="lang-shell"><span class="token shebang important">#!/bin/bash</span>
<span class="token function">curl</span> ip.sb
</code></pre>
<h3 id="&#x65E5;&#x5E38;&#x63D0;&#x4EA4;&#x63A8;&#x9001;git&#x4EE3;&#x7801;">&#x65E5;&#x5E38;&#x63D0;&#x4EA4;&#x63A8;&#x9001;git&#x4EE3;&#x7801;</h3>
<pre class="language-"><code class="lang-shell"><span class="token shebang important">#!/bin/bash</span>

<span class="token builtin class-name">read</span> -p <span class="token string">&quot;&#x8F93;&#x5165;&#x63D0;&#x4EA4;&#x65E5;&#x5FD7;&#x4FE1;&#x606F;: &quot;</span> commit_message
<span class="token builtin class-name">read</span> -p <span class="token string">&quot;&#x8F93;&#x5165;&#x5206;&#x652F;&#x540D;(&#x9ED8;&#x8BA4;&#x4E3A;dev&#x5206;&#x652F;): &quot;</span> branch_name

<span class="token keyword">if</span> <span class="token punctuation">[</span><span class="token punctuation">[</span> -n <span class="token string">&quot;<span class="token variable">${commit_message}</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
    <span class="token comment">#statements</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;&#x65E5;&#x5FD7;&#x4FE1;&#x606F;&#x53C2;&#x6570;&#x4E3A;: <span class="token variable">${commit_message}</span>&quot;</span>
<span class="token keyword">else</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;&#x65E5;&#x5FD7;&#x4FE1;&#x606F;&#x53C2;&#x6570;&#x4E3A;&#x7A7A;&#xFF0C;&#x5DF2;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x6A21;&#x677F;: &#x1F680;update~&quot;</span>
    <span class="token assign-left variable">commit_message</span><span class="token operator">=</span><span class="token string">&quot;&#x1F680;update~&quot;</span>
<span class="token keyword">fi</span>

<span class="token keyword">if</span> <span class="token punctuation">[</span><span class="token punctuation">[</span> -n <span class="token string">&quot;<span class="token variable">${branch_name}</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
    <span class="token comment">#statements</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;&#x5206;&#x652F;&#x540D;&#x53C2;&#x6570;&#x4E3A;: <span class="token variable">${branch_name}</span>&quot;</span>
<span class="token keyword">else</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;&#x5206;&#x652F;&#x540D;&#x53C2;&#x6570;&#x672A;&#x8F93;&#x5165;,&#x9ED8;&#x8BA4;&#x4E3A;dev&quot;</span>
    <span class="token assign-left variable">branch_name</span><span class="token operator">=</span><span class="token string">&quot;dev&quot;</span>
<span class="token keyword">fi</span>

<span class="token function">git</span> <span class="token function">add</span> <span class="token builtin class-name">.</span>
<span class="token function">git</span> commit -am  <span class="token string">&quot;<span class="token variable">${commit_message}</span>&quot;</span>
<span class="token function">git</span> push origin <span class="token variable">${branch_name}</span>
</code></pre>
<h3 id="&#x7EDF;&#x8BA1;ios&#x4EE3;&#x7801;&#x884C;&#x6570;">&#x7EDF;&#x8BA1;iOS&#x4EE3;&#x7801;&#x884C;&#x6570;</h3>
<pre class="language-"><code class="lang-shell"><span class="token shebang important">#!/bin/bash</span>
    <span class="token builtin class-name">read</span> -p <span class="token string">&quot;&#x8F93;&#x5165;&#x4EE3;&#x7801;&#x6587;&#x4EF6;&#x6240;&#x5728;&#x8DEF;&#x5F84;: &quot;</span> code_path
    <span class="token function">find</span> <span class="token variable">${code_path}</span> <span class="token string">&quot;(&quot;</span> -name <span class="token string">&quot;*.h&quot;</span> -or -name <span class="token string">&quot;*.mm&quot;</span> -or -name <span class="token string">&quot;*.m&quot;</span> -or -name <span class="token string">&quot;*.swift&quot;</span> <span class="token string">&quot;)&quot;</span> -print <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">wc</span> -l
</code></pre>
<h3 id="plistbuddy&#x76F8;&#x5173;&#x7684;&#x64CD;&#x4F5C;"><code>Plistbuddy</code>&#x76F8;&#x5173;&#x7684;&#x64CD;&#x4F5C;</h3>
<ul>
<li><p>&#x6DFB;&#x52A0;<code>name</code>&#x5B57;&#x6BB5; &#x503C;&#x4E3A;<code>iqiyi</code></p>
<pre class="language-"><code class="lang-shell">plistbuddy -c <span class="token string">&apos;Add :items:0:metadata:name string &quot;iqiyi&quot;&apos;</span> ~/Desktop/man.plist
</code></pre>
</li>
<li><p>&#x4FEE;&#x6539;<code>title</code>&#x503C;&#x4E3A;<code>&#x4F60;&#x597D;</code></p>
<pre class="language-"><code class="lang-shell">plistbuddy -c <span class="token string">&apos;Set :items:0:metadata:title &quot;&#x4F60;&#x597D;&quot;&apos;</span> ~/Desktop/man.plist
</code></pre>
</li>
<li><p>&#x5220;&#x9664;<code>name</code>&#x5B57;&#x6BB5;</p>
<pre class="language-"><code class="lang-shell">plistbuddy -c <span class="token string">&apos;Delete :items:0:metadata:name &apos;</span> ~/Desktop/man.plist
</code></pre>
</li>
<li><p>&#x5408;&#x5E76;&#x4E24;&#x4E2A;<code>plist</code> &#x53EF;&#x8BBE;&#x7F6E;&#x5C42;&#x7EA7;</p>
<pre class="language-"><code class="lang-shell">PlistBuddy -c <span class="token string">&apos;Merge A.plist&apos;</span> B.plist
plistbuddy -c <span class="token string">&quot;Merge ~/Desktop/Global.plist :Software:Gallery&quot;</span>~/Desktop/man.plist
</code></pre>
</li>
<li>&#x6253;&#x5370;</li>
</ul>
<pre class="language-"><code class="lang-shell">plistbuddy -c <span class="token string">&apos;Print&apos;</span> ~/Desktop/man.plist
</code></pre>
<h2 id="&#x4FEE;&#x6539;&#x7EC8;&#x7AEF;&#x6B22;&#x8FCE;&#x9875;&#x9762;">&#x4FEE;&#x6539;&#x7EC8;&#x7AEF;&#x6B22;&#x8FCE;&#x9875;&#x9762;</h2>
<pre class="language-"><code class="lang-shell"><span class="token comment"># &#x65E0;&#x8BBA;&#x662F;linux&#x8FD8;&#x662F;Mac,&#x7EC8;&#x7AEF;&#x90FD;&#x6709;&#x8FD9;&#x4E48;&#x4E00;&#x4E2A;&#x914D;&#x7F6E;&#x6587;&#x4EF6;,&#x4E13;&#x95E8;&#x8BBE;&#x7F6E;&#x521D;&#x59CB;&#x9875;&#x9762;&#x7684;&#x5C55;&#x793A;,&#x53EF;&#x4EE5;&#x81EA;&#x7531;&#x53D1;&#x6325;(&#x5199;&#x4E0A;&#x81EA;&#x5DF1;&#x7684;&#x5927;&#x540D;&#x6216;&#x8005;&#x753B;&#x4E00;&#x5F20;ascii&#x56FE;&#x4F5B;&#x7956;&#x4FDD;&#x4F51;&#x6C38;&#x65E0;bug&#x4E4B;&#x7C7B;&#x7684;,&#x5EA7;&#x53F3;&#x94ED;&#x5565;&#x7684;...)</span>
<span class="token function">vim</span> /etc/motd
</code></pre>
<h2 id="oh-my-zsh&#x7684;agnoster&#x7684;&#x4E3B;&#x9898;&#x914D;&#x7F6E;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x51E0;&#x4E2A;&#x95EE;&#x9898;"><code>oh-my-zsh</code>&#x7684;<code>agnoster</code>&#x7684;&#x4E3B;&#x9898;&#x914D;&#x7F6E;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x51E0;&#x4E2A;&#x95EE;&#x9898;</h2>
<p>```shell</p>
<h1 id="agnoster&#x4E3B;&#x9898;zsh&#x9ED8;&#x8BA4;&#x76EE;&#x5F55;&#x662F;&#x4E0D;&#x5E26;&#x989C;&#x8272;&#x7684;&#x5728;zshrc&#x672B;&#x5C3E;&#x52A0;&#x4E0A;&#x5373;&#x53EF;">agnoster&#x4E3B;&#x9898;,zsh&#x9ED8;&#x8BA4;&#x76EE;&#x5F55;&#x662F;&#x4E0D;&#x5E26;&#x989C;&#x8272;&#x7684;,&#x5728;.zshrc&#x672B;&#x5C3E;&#x52A0;&#x4E0A;&#x5373;&#x53EF;</h1>
<p>export LSCOLORS=&quot;exfxcxdxbxexexabagacad&quot;</p>
<h1 id="&#x4FEE;&#x6539;&#x7EC8;&#x7AEF;&#x8DEF;&#x5F84;&#x524D;&#x7F00;&#x9ED8;&#x8BA4;&#x4E3A;&#x7535;&#x8111;&#x7528;&#x6237;&#x540D;&#x53EF;&#x4EE5;&#x5728;oh-my-zshthemesagnosterzsh-theme&#x4FEE;&#x6539;promptcontext&#x51FD;&#x6570;&#x6216;&#x8005;&#x5C06;&#x5176;&#x8C03;&#x7528;&#x6CE8;&#x91CA;&#x5373;&#x53EF;&#x7F29;&#x77ED;&#x8DEF;&#x5F84;&#x957F;&#x5EA6;">&#x4FEE;&#x6539;&#x7EC8;&#x7AEF;&#x8DEF;&#x5F84;&#x524D;&#x7F00;,&#x9ED8;&#x8BA4;&#x4E3A;&#x7535;&#x8111;&#x7528;&#x6237;&#x540D;,&#x53EF;&#x4EE5;&#x5728;~/.oh-my-zsh/themes/agnoster.zsh-theme&#x4FEE;&#x6539;prompt_context&#x51FD;&#x6570;&#x6216;&#x8005;&#x5C06;&#x5176;&#x8C03;&#x7528;&#x6CE8;&#x91CA;&#x5373;&#x53EF;&#x7F29;&#x77ED;&#x8DEF;&#x5F84;&#x957F;&#x5EA6;</h1>
<p>prompt_context() {
  if [[ &quot;$USER&quot; != &quot;$DEFAULT_USER&quot; || -n &quot;$SSH_CLIENT&quot; ]]; then</p>
<pre class="language-"><code># prompt_segment black default &quot;%(!.%{%F{yellow}%}.)$USER@%m&quot;
prompt_segment red default &quot;&#x1F3AF;Coding&quot;
</code></pre><p>  fi
}</p>
<h1 id="&#x6539;&#x53D8;&#x8DEF;&#x5F84;&#x663E;&#x793A;&#x989C;&#x8272;&#x548C;&#x7F29;&#x51CF;&#x8DEF;&#x5F84;&#x957F;&#x5EA6;">&#x6539;&#x53D8;&#x8DEF;&#x5F84;&#x663E;&#x793A;&#x989C;&#x8272;&#x548C;&#x7F29;&#x51CF;&#x8DEF;&#x5F84;&#x957F;&#x5EA6;</h1>
<p>prompt_dir() {</p>
<h1 id="promptsegment-blue-black--&#x9ED8;&#x8BA4;&#x663E;&#x793A;&#x5168;&#x8DEF;&#x5F84;">prompt_segment blue black &apos;%~&apos; #&#x9ED8;&#x8BA4;&#x663E;&#x793A;&#x5168;&#x8DEF;&#x5F84;</h1>
<p>   prompt_segment 3 white &apos;%c&apos; #&#x53EA;&#x663E;&#x793A;&#x5F53;&#x524D;&#x8DEF;&#x5F84;
}</p>
<h1 id="&#x8FD8;&#x6709;&#x6709;git&#x7BA1;&#x7406;&#x7684;&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x8DEF;&#x5F84;&#x989C;&#x8272;&#x663E;&#x793A;&#x4E5F;&#x53EF;&#x4EE5;&#x6539;promptgit&#x51FD;&#x6570;">&#x8FD8;&#x6709;&#x6709;git&#x7BA1;&#x7406;&#x7684;&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x8DEF;&#x5F84;&#x989C;&#x8272;&#x663E;&#x793A;&#x4E5F;&#x53EF;&#x4EE5;&#x6539;prompt_git&#x51FD;&#x6570;</h1>
<p> if [[ -n $dirty ]]; then</p>
<pre class="language-"><code>  #prompt_segment yellow black
  prompt_segment yellow white
else
  #prompt_segment green black
  prompt_segment green  white
fi
</code></pre><p>```<hr><div id="vcomments"></div><script src="//unpkg.com/valine/dist/Valine.min.js"></script><script>new Valine({el: "#vcomments",appId: 'oT5vWHkWT1JN1o5aXiSqYGtH-gzGzoHsz',appKey: 'V7zBLpzBgxVESicbyF072Cj9',placeholder: 'Just go go',avatar: '',meta: undefined,pageSize: 10,lang: 'zh-CN',recordIP: false})</script> </p>
<footer class="page-footer"><span class="copyright">CoderWGB all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x7AE0;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-01-31 20:55:53
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: Shell相关">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="关于Xcode12静态库打包的一些心得.html" class="navigation navigation-next " aria-label="Next page: 关于Xcode12静态库打包的一些心得">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"我折腾的shell笔记","level":"1.4.1","depth":2,"next":{"title":"关于Xcode12静态库打包的一些心得","level":"1.4.2","depth":2,"path":"books/Shell/关于Xcode12静态库打包的一些心得.md","ref":"./books/Shell/关于Xcode12静态库打包的一些心得.md","articles":[]},"previous":{"title":"Shell相关","level":"1.4","depth":1,"path":"books/Shell/README.md","ref":"./books/Shell/README.md","articles":[{"title":"我折腾的shell笔记","level":"1.4.1","depth":2,"path":"books/Shell/我折腾的shell笔记.md","ref":"./books/Shell/我折腾的shell笔记.md","articles":[]},{"title":"关于Xcode12静态库打包的一些心得","level":"1.4.2","depth":2,"path":"books/Shell/关于Xcode12静态库打包的一些心得.md","ref":"./books/Shell/关于Xcode12静态库打包的一些心得.md","articles":[]},{"title":"剪贴板的使用","level":"1.4.3","depth":2,"path":"books/Shell/剪贴板的使用.md","ref":"./books/Shell/剪贴板的使用.md","articles":[]},{"title":"指定入参的使用","level":"1.4.4","depth":2,"path":"books/Shell/指定入参的使用.md","ref":"./books/Shell/指定入参的使用.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["back-to-top-button","chapter-fold","code","copy-code-button","splitter","valine","-lunr","-search","search-pro","insert-logo","custom-favicon","pageview-count","tbfed-pagefooter","popup","-sharing","sharing-plus","-highlight","prism","prism-themes","simple-page-toc"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"CoderWGB","modify_label":"该文章修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"prism":{"css":["prism-themes/themes/prism-xonokai.css"]},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"splitter":{},"search-pro":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"popup":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"favicon":"./logo.ico","back-to-top-button":{},"pageview-count":{},"prism-themes":{},"custom-favicon":{},"copy-code-button":{},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":true,"facebook":true,"weibo":true,"twitter":true,"pocket":true,"google":true,"qzone":true},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"insert-logo":{"style":"background: none; max-height: 30px; min-height: 30px","url":"https://cdn.jsdelivr.net/gh/WangGuibin/MyFilesRepo/images/20210130164238.png"},"valine":{"avatar":"","lang":"zh-CN","pageSize":10,"placeholder":"Just go go","recordIP":false,"appId":"oT5vWHkWT1JN1o5aXiSqYGtH-gzGzoHsz","appKey":"V7zBLpzBgxVESicbyF072Cj9"}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Summary","gitbook":"*"},"file":{"path":"books/Shell/我折腾的shell笔记.md","mtime":"2021-01-31T12:55:53.146Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-01-31T13:01:17.483Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

